package com.dfbz.demo04_泛型方法;

import com.dfbz.demo01_泛型的好处.Book;
import com.dfbz.demo01_泛型的好处.Province;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01 {

    public static void main(String[] args) {

        GetClassMethod method1=new GetClassMethod();
        Province province = method1.getClass(new Province("江西","赣","华东"));
        province.intro();


        Book book = method1.getClass(new Book("《孙子兵法》", "孙膑"));
        book.detail();
    }

}


class GetClassMethod {

    // 定义泛型方法
    public <E> E getClass(E e){
        return e;
    }
}
